package com.snopy.order.service;

import com.snopy.order.pojo.OrderStatus;
import com.snopy.order.pojo.bo.SubmitOrderBO;
import com.snopy.order.pojo.vo.OrderVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author snopy
 * @version 1.0.0
 * @classname OrdersService
 * @description
 * @email 77912204@qq.com
 * @date 2020/09/28 20:40
 */
@FeignClient("snopy-order-service")
@RequestMapping("order-api")
public interface OrdersService {

    /**
     * 用于创建订单相关信息
     * @param submitOrderBO
     */
    @PostMapping("createOrder")
    public OrderVO createOrder(@RequestBody SubmitOrderBO submitOrderBO);

    /**
     * 修改订单状态
     * @param orderId
     * @param orderStatus
     */
    @PostMapping("updateOrderStatus")
    public void updateOrderStatus(@RequestParam("orderId") String orderId,
                                  @RequestParam("orderStatus") Integer orderStatus);

    /**
     * 查询订单支付状态
     * @param orderId
     * @return
     */
    @GetMapping("queryOrderStatusInfo")
    OrderStatus queryOrderStatusInfo(@RequestParam("orderId")String orderId);

    /**
     * 关闭超时未支付订单
     */
    @PostMapping("closeOrder")
    public void closeOrder();
}
